#!/bin/bash

name=flask
tag=latest
port2=8083
port1=5000

git pull
docker build  -t $name:$tag .

if [ "$(docker ps -aq -f name=$name)" ]; then
    echo "Container $name exists, deleting it..."
    docker rm -f $name
else
    echo "Container $name does not exist."
fi

docker run -id --name $name -p $port2:$port1    $name:$tag

#docker images | grep none | awk '{print $3}' | xargs docker rmi -f


nohup python app.py > webhook.log 2>&1 &